﻿using CommonType;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S_Gridding.Domains.FoundGridding;
using S_Gridding.Read.Api.Application.Commands;
using S_Userinfor.Domains;

namespace S_Gridding.Read.Api.Controllers
{
    /// <summary>
    /// 网格信息管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GriddingController : ControllerBase
    {
        private readonly IMediator _mediator;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator"></param>
        public GriddingController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 网格信息列表
        /// </summary>
        /// <param name="commons"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<PageResule<Gridding>> PageShowCottage([FromQuery] GriddingShowCommands commons)
        {
            return await _mediator.Send(commons);
        }

    }
}
